package com.app.model.bean;


import com.app.BuildConfig;

import java.io.Serializable;

public class Page implements Serializable {

    // 总的条目数
    private int totalCount;
    // 总的页面数
    private int totalPage;
    // 当前页码
    private int pageNum = 1;
    // 页面大小，每个分页显示条目数
    private int pageSize = 10;

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public boolean nextPage() {
        if (pageNum < totalPage) {
            pageNum ++;
            return true;
        } else
            return false;
    }

    @Override
    public String toString() {
        if (!BuildConfig.DEBUG) {
            return super.toString();
        }
        return "Page{" +
                "totalCount=" + totalCount +
                ", totalPage=" + totalPage +
                ", pageNum=" + pageNum +
                ", pageSize=" + pageSize +
                '}';
    }
}
